﻿app.factory('lessonFactory', function ($http) {
    var factory = {};

    factory.getLessons = function (dataPost) {
        return $http.post(getLessonsApiAddress, dataPost);
    };
    factory.getLessonDetail = function(id) {
        return $http.get(getLessonDetailApiAddress + id);
    };
    
    factory.postLesson = function(dataPost) {
        return $http.post(postLessonApiAddress, dataPost);
    };
    
    factory.putLesson = function(dataPost) {
        return $http.post(updateLessonApiAddress, dataPost);
    };
    factory.getDataSpeakConfig = function () {
        return $http.get(getDataSpeakConfigApiAddress);
    };
    factory.getDataSpeak = function () {
        return $http.get(getDataSpeakApiAddress);
    };
    return factory;
});